POV-Ray : Newsgroups : povray.newusers : file i/o directives : file i/o directives Server Time
30 Jul 2024 06:30:51 EDT (-0400)
  file i/o directives  
From: aitzolmuelas
Date: 18 Aug 2004 12:50:00
Message: <web.412388722ebe0504b394c41d0@news.povray.org>
Hi there,

I am using some file io support to store data to be read later on, but I am
having some troubles. The file the data is read from a file in this format:

<a, b>, <c, d>
<e, f>, <g, h>
<i, j>, <k, l>
....

meaning two uv vectors separated by comma for eac line. The code that has to
be parsed is this:

#fopen a_file "grid.txt" read
//#declare vector1 = <0, 0>;
//#declare vector2 = <0, 0>;
#while(defined(a_file))
   #read(a_file, vector1, vector2)
   box{
      <vector1.x, vector1.y, -.001>, <vector2.x, vector2.y, .001>
      }
   #undef vector1
   #undef vector2
#end
#fclose a_file

the problem arises when parsing the statement in the box clause (the
vectors) The error message is "bad operands for period operator". If the
first two declarative lines are uncommented (as well as the undefs), the
error message reads: "expected 'undeclared identifier', uv vector
identifier found instead."
I thought that "read" worked fine with undeclared identifiers? Someone help
please, this is driving me mad!


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.